package com.itic.appbase.framework.type;

public enum RegionLevel {

    Province(0,"省"),City(1,"市"),Region(2,"区");

    private int level;
    private String  name;

    RegionLevel(int level, String name) {
        this.level = level;
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public String getName() {
        return name;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static   RegionLevel getRegionLevel(int level){
        RegionLevel RegionLevel = null;
        switch (level){
            case 0:
                RegionLevel = RegionLevel.Province;
            break;
            case 1:
                RegionLevel = RegionLevel.City;
                break;
            case 2:
                RegionLevel = RegionLevel.Region;
                break;
        }
        return RegionLevel;
    }
}
